# 这个题要注意的是细节的条件一定不能丢，这是该题的易错点
class Solution:
    def lemonadeChange(self, bills: List[int]) -> bool:
        count5, count10 = 0, 0
        for v in bills:
            if v == 5:
                count5 += 1
            elif v == 10:
                if count5 <= 0:
                    return False
                else:
                    count5 -= 1
                    count10 += 1
            else:
                if count5 <= 0:
                    return False
                elif count5 == 1 or count5 == 2:
                    if count10 >= 1:
                        count10 -= 1
                        count5 -= 1
                    else:
                        return False
                else:
                    if count10 >= 1:
                        count10 -= 1
                        count5 -= 1
                    else:
                        count5 -= 3
        return True